// import { Goods } from '@element-plus/icons-vue/dist/types'
// import { helper } from 'echarts'
import http from '../utils/http/index'


// 后台登录
export const ApiLogin = (name: string, passwd: string) => http.get(`ManagerController/managerLogin?name=${name}&passwd=${passwd}`)

// 获取所有物资列表商品
export const ApiGoodsList = () => http.get(`GoodsController/queryGoodsByName`)
// 修改物资信息
export const ApiGetChangeGood = (goodsid, goodsnum, goodsname, maxrentnum, push) => http.get(`GoodsController/updateGoods?goodsid=${goodsid}&goodsnum=${goodsnum}&goodsname=${goodsname}&maxrentnum=${maxrentnum}&push=${push}`)
// 增加物资信息
export const ApiAddGoods = (goodsnum, goodsname, maxrentnum, push) => http.get(`GoodsController/addGoods?goodsname=${goodsname}&goodsnum=${goodsnum}&maxrentnum=${maxrentnum}&push=${push}`)
// 删除物资
export const ApiDeTheGood = (id) => http.get(`GoodsController/deleteGoodsById?goodsid=${id}`)

// 获取所有场地信息
export const ApiGetPlaceList = () => http.get(`PlaceController/queryplacebyname`)
// 场地增加
export const ApiGetAddPlace = (name, type) => http.get(`PlaceController/addPlace?placename=${name}&placetype=${type}`)
// 场地修改 
export const ApiEditPlace = (placeid, placepho, placetype, placename, push) => http.get(`PlaceController/updatePlace?placeid=${placeid}&placepho=${placepho}&placetype=${placetype}&placename=${placename}&push=${push}`)
// 场地删除
export const ApiDeletPlace = (id) => http.get(`PlaceController/deletePlaceById?placeid=${id}`)

// 校长办公

// 校长物资
export const ApiGetRecordByHig = () => http.get(`GoodsappointmentController/getGoodsappointment?judge=1`)
export const ApiGetJuByHig = (userid, goodsid, starttime, endtime, judge, rentnum) => http.get(`GoodsappointmentController/judgeGoodsappointment?userid=${userid}&goodsid=${goodsid}&starttime=${starttime}&endtime=${endtime}&judge=${judge}&rentnum=${rentnum}`)

// 校长的场地
export const ApiGetPlaceByHig = () => http.get(`PlaceappointmentController/queryappointment?judge=1`)
export const ApiGetJuPlaceSchool = (userid, placeid, starttime, endtime, judge) => http.get(`PlaceappointmentController/judgePlaceappoinment?userid=${userid}&placeid=${placeid}&starttime=${starttime}&endtime=${endtime}&judge=${judge}`)

// 院长办公
// 院长物资
export const ApiGetRecordByMid = () => http.get(`GoodsappointmentController/getGoodsappointment?judge=0`)
export const ApiGetJuByMid = (userid, goodsid, starttime, endtime, judge, rentnum) => http.get(`GoodsappointmentController/judgeGoodsappointment?userid=${userid}&goodsid=${goodsid}&starttime=${starttime}&endtime=${endtime}&judge=${judge}&rentnum=${rentnum}`)
// 院长场地
export const ApiGetPlaceByMid = () => http.get(`PlaceappointmentController/queryappointment?judge=0`)
export const ApiGetJuPlaceByMid = (userid, placeid, starttime, endtime, judge) => http.get(`PlaceappointmentController/judgePlaceappoinment?userid=${userid}&placeid=${placeid}&starttime=${starttime}&endtime=${endtime}&judge=${judge}`)

